package com.google.code.tretris.network;

import com.google.code.tretris.network.exceptions.NotConnectedException;
import com.google.code.tretris.network.game.GameNetworkInterface;

public interface NetworkTNG extends GameNetworkInterface {
	/**
	 * Connect and authenticate to the network as the given principal.
	 * 
	 * @param username
	 * @param password
	 * @throws NotConnectedException
	 *             If unable to connect to the network.
	 */
	public void connect(String username, String password)
			throws NotConnectedException;

	/**
	 * Check if we are connected to the network.
	 * 
	 * @return true if we have an authenticated live connection to the network.
	 */
	public boolean isConnected();
	
	/**
	 * Disconnect from the network.
	 */
	public void disconnect() ;

	/**
	 * Invite the given principal to play a game.
	 * 
	 * @param username
	 * @return true if the given player is a friend and is connected and waiting
	 *         for the game to start. False otherwise.
	 */
	public boolean invitePlayer(String username);

	// Add methods for getting the roster so we can make a nice GUI to invite players.
}
